package com.sky.blog.controller;

import com.sky.blog.service.SocialService;
import com.sky.blog.service.SysUserService;
import com.sky.blog.vo.Results;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author sky  2022/3/26
 * @version 1.0
 */

@RestController
@RequestMapping("/blog/app")
public class BlogAppController {

    @Resource
    private SysUserService sysUserService;

    @Resource
    private SocialService socialService;

    @GetMapping("site")
    public Results blogSite(@RequestParam(name = "blogUserId", required = false) Long blogUserId) {
        return Results.SUCCESS.data(sysUserService.getBlogSite(blogUserId));
    }

    @GetMapping("social")
    public Results blogSocial() {
        return Results.SUCCESS.data(socialService.getSocial());
    }

}
